package vip.xiaonuo.supplier.modular.warehouse.stocks.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import vip.xiaonuo.common.pojo.CommonEntity;
import vip.xiaonuo.supplier.modular.base.productions.entity.SupplierProductions;
import vip.xiaonuo.supplier.modular.base.stores.entity.SupplierStores;
import vip.xiaonuo.supplier.modular.custom.objects.entity.SupplierObjects;
import vip.xiaonuo.supplier.modular.purchase.suppliers.entity.SupplierSuppliers;
import vip.xiaonuo.supplier.modular.warehouse.storages.entity.SupplierStorages;
import vip.xiaonuo.supplier.modular.warehouse.storeslocation.entity.SupplierStoresLocation;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 库存明细实体
 *
 * @author Mr.wu
 * @date  2025/03/18 14:28
 **/
@Getter
@Setter
@TableName("SUPPLIER_STOCKS")
public class SupplierStocks extends CommonEntity {

    /** 库存ID */
    @TableId
    @Schema(description = "库存ID")
    private String id;

    /** 门店ID */
    @Schema(description = "门店ID")
    @Trans(type = TransType.SIMPLE, target = SupplierStores.class, fields = "storeName", alias = "stores", ref = "stockStoreIdName")
    private String stockStoreId;

     /**门店ID名称 */
    @Schema(description = "门店ID名称")
    @TableField(exist = false)
    private String stockStoreIdName;

    /** 仓库ID */
    @Schema(description = "仓库ID")
    @Trans(type = TransType.SIMPLE, target = SupplierStorages.class, fields = "storeName", alias = "storages", ref = "stockStorageIdName")
    private String stockStorageId;

     /**仓库ID名称 */
    @Schema(description = "仓库ID名称")
    @TableField(exist = false)
    private String stockStorageIdName;

    /** 商品ID */
    @Schema(description = "商品ID")
    @Trans(type = TransType.SIMPLE, target = SupplierProductions.class, fields = {"productionCode","productionBarcode","productionName","productionSpec","productionUnit","productionUnitAuxiliary"}, alias = "productions", refs = {"stockProductionCode","stockProductionBarcode","stockProductionName","stockProductionSpec","stockProductionUnit","stockProductionUnitAuxiliary"})
    private String stockProductionId;

    /** 商品编码 */
    @Schema(description = "商品编码")
    @TableField(exist = false)
    private String stockProductionCode;

    /** 主条码 */
    @Schema(description = "主条码")
    @TableField(exist = false)
    private String stockProductionBarcode;

    /** 商品名称 */
    @Schema(description = "商品名称")
    @TableField(exist = false)
    private String stockProductionName;

    /** 规格 */
    @Schema(description = "规格")
    @TableField(exist = false)
    private String stockProductionSpec;

    /** 单位 */
    @Schema(description = "单位")
    @TableField(exist = false)
    private String stockProductionUnit;

    /** 辅助单位 */
    @Schema(description = "辅助单位")
    @TableField(exist = false)
    private String stockProductionUnitAuxiliary;

    /** 采购单价 */
    @Schema(description = "采购单价")
    private BigDecimal stockPriceProcure;

    /** 最近一次采购单价 */
    @Schema(description = "最近一次采购单价")
    private BigDecimal stockPriceProcureLast;

    /** 商品库存 */
    @Schema(description = "商品库存")
    private BigDecimal stockStock;

    /** 库存金额 */
    @Schema(description = "库存金额")
    private BigDecimal stockAmount;

    /** 库位 */
    @Schema(description = "库位")
    @Trans(type = TransType.SIMPLE, target = SupplierStoresLocation.class, fields = "locationCode", alias = "storesLocation", ref = "stockStoreLocationName")
    private String stockStoreLocation;

     /**库位名称 */
    @Schema(description = "库位名称")
    @TableField(exist = false)
    private String stockStoreLocationName;

    /** 批次 */
    @Schema(description = "批次")
    private String stockBatch;

    /** 生产日期 */
    @Schema(description = "生产日期")
    private Date stockDateManufacture;

    /** 供应商 */
    @Schema(description = "供应商")
    @Trans(type = TransType.SIMPLE, target = SupplierObjects.class, fields = "objectName", alias = "object", ref = "stockSupplierName")
    private String stockSupplier;

     /**供应商名称 */
    @Schema(description = "供应商名称")
    @TableField(exist = false)
    private String stockSupplierName;

    /** 数据归属 */
    @Schema(description = "数据归属")
    private String companyId;
}
